using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;

namespace Sedna.Core.Controller.Configurations
{
    /// <summary>
    /// Replaces each space with &nbsp; sign to save spaces when string will be displayed.
    /// </summary>
    public class GapInStringTranslator : IDataTranslator
    {
        public object Translate(Control control, object value)
        {
            return Translate(control, value, null);
        }

        public object Translate(Control control, object value, Type targetType)
        {
            StringBuilder sb = new StringBuilder(value.ToString());
            sb.Replace(" ", "&nbsp;");
            return sb.ToString();
        }
    }
}
